const state = {
    info: {
        type:'',
        options:[]
    }
}


const mutations = {
    SET_INFO: (state, info) => {
        state.info = info
    },
    SET_OPTIONS: (state, options) => {
        state.info.options = options
    },

}

const actions = {
    setInfo({ commit },questionInfo) {
        if(!questionInfo.options){
            questionInfo.options  = state.info.options
        }
        commit('SET_INFO', questionInfo)
    },
    setOptions({ commit },optionsArr) {
        commit('SET_OPTIONS', optionsArr)
    },

}


export default {
    namespaced: true,
    state,
    mutations,
    actions
}
